package com.bysj.service;

import com.bysj.dao.CollectedTopicDao;
import com.bysj.entity.CollectedTopic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectedTopicServiceImpl implements CollectedTopicService {
    @Autowired
    CollectedTopicDao collectedTopicDao;

    //添加收藏的贴子
    @Override
    public void addCollectTopic(CollectedTopic collectedTopic) {
        collectedTopicDao.addCollectTopic(collectedTopic);
    }
    //根据用户id获取用户收藏的贴子
    @Override
    public List<CollectedTopic> getCollectTopicByUid(Integer uid) {
        return collectedTopicDao.getCollectTopicByUid(uid);
    }
    //根据用户和商品id删除已收藏的贴子
    @Override
    public void deleteCollectTopicById(Integer tid, Integer uid) {
        collectedTopicDao.deleteCollectTopicById(tid,uid);
    }
}
